<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<div class="row">
    <div class="col-lg-12">
        <h3 class="page-header">Trả lời câu hỏi</h3>
    </div>
    <!-- /.col-lg-12 -->
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-12">
                        <form role="form" method="POST" name="EditFeedback" onsubmit="return checkinput();">
                            <div class="form-group">
                                <div class="row">
                                    <div class="col-lg-3">
                                        <label>Tiêu đề:</label>
                                    </div>
                                    <div class="col-lg-6">
                                        <input class="form-control" name="title_feedback" id="title_feedback" value="<?php echo $this->item->getTitle(); ?>" disabled="disabled" >
                                    </div>  
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="row">
                                    <div class="col-lg-3">
                                        <label>Câu Hỏi</label>
                                    </div>
                                    <div class="col-lg-12">
                                        <textarea class="form-control" name="question" id="question" disabled="disabled" > <?php  echo $this->item->getQuestion()?></textarea>                                   
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-3">
                                        <label>Câu Trả Lời</label>
                                    </div>
                                    <div class="col-lg-12">
                                        <textarea class="ckeditor" name="answer" id="answer"><?php  echo $this->item->getAnswer()?></textarea>                                   
                                    </div>
                                </div>
                            </div>
                            <div class="form-group"><center>
                                <button type="submit" class="btn btn-primary"id="submit">Lưu</button>
                                <button type="reset" class="btn btn-default" id="reset">Đặt lại</button></center>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>   
</div>
<script type="text/javascript">
    document.forms['EditFeedback'].name.focus();
    function set_focus() {
        document.forms['EditFeedback'].name.focus();
    }
    function checkinput(){
        var frm = window.document.EditFeedback;   
        if(CKEDITOR.instances.answer.getData()==""){
            bootbox.alert("Vui lòng nhập nội dung cho câu trả lời");
            return false;
        }
        return true;
    }
</script>
<script type="text/javascript">
     $(document).ready(function () {
        CKEDITOR.replace('answer');
//        CKEDITOR.replace('question',{
//            toolbar:[                   																			// Line break - next group will be placed in new line.
//                        { name: 'basicstyles', items: [  ] }
//                    ]
//            });           
    });  
    $('#reset').click( function ( e ){	
        CKEDITOR.instances.answer.setData("");
    }); 
</script>
